package com.STS.ELearning.Classes
{
	import flash.display.Sprite;
	import flash.system.System;
	import flash.utils.setTimeout;
	
	import mx.controls.Alert;
	import mx.events.CloseEvent;

	public class MyAlert extends Alert
	{
		
		[Embed(source="/assets/images/alert_error.gif")]
		private static var iconError:Class;
		
		[Embed(source="/assets/images/alert_info.gif")]
		private static var iconInfo:Class;
		
		[Embed(source="/assets/images/alert_confirm.gif")]
		private static var iconConfirm:Class;
		
		public static function info(message:String, closehandler:Function=null,parent:Sprite=null):void{
			okLabel="Tamam";
			show(message, "Bilgi", Alert.OK, parent, closehandler, iconInfo);
		}
		public static function error(message:String, closehandler:Function=null,parent:Sprite=null):void{
			okLabel="Kapat";
			show(message, "Hata", Alert.OK, parent, closehandler, iconError);
		}
		public static var alertReturned:Boolean=false;
		public static function confirm(message:String, closehandler:Function,parent:Sprite=null):void{
			yesLabel="Evet";
			noLabel="Hayır";
			show(message, "Uyarı", Alert.YES | Alert.NO, parent,
						function(evt:CloseEvent):void{
						alertReturned=true;
						closehandler(evt);
						},iconConfirm);
		}
		
	}
	
}